package hn.cch.redis_token.message;

import io.swagger.annotations.ApiModelProperty;

/**
 * Created by chench on 2020-6-11.
 */
public class TokenResponse {



    @ApiModelProperty(value = "代码")
    private String code;
    @ApiModelProperty(value = "说明")
    private String text;
    @ApiModelProperty(value = "数据")
    private String data;
    @ApiModelProperty(value = "下一个token")
    private String valid;


    public static TokenResponse success(){
        TokenResponse tokenResponse = new TokenResponse();
        tokenResponse.code = "200";
        tokenResponse.text = "成功";
        return tokenResponse;
    }

    public static TokenResponse failed(){
        TokenResponse tokenResponse = new TokenResponse();
        tokenResponse.code = "400";
        tokenResponse.text = "失败";
        return tokenResponse;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getValid() {
        return valid;
    }

    public void setValid(String valid) {
        this.valid = valid;
    }
}
